In [4]:
%matplotlib inline
In [5]:
import pandas
In [27]:
data = pandas.read_csv("OCTGN_stats_anonymized-2014-04-01.csv")
In [72]:
data.Result.value_counts()
Out[72]:
In [65]:
data.Corporation.value_counts()
Out[65]:
In [67]:
data.Runner.value_counts()
Out[67]:
In [114]:
plots=[data.Turns_Played.plot(title="Corporate Victories", legend=True, label="Turns Played", kind='hist', bins=range(1,60)),
data.Turns_Played[data.Result=="AgendaVictory"].plot(legend=True,
label="Agenda Victory",
kind='hist', bins=range(1,60)),
data.Turns_Played[data.Result=="FlatlineVictory"].plot(legend=True,
label="Flatline Victory",
kind='hist', bins=range(1,60))]
plots[1].set_xlabel("Turns")
plots[1].set_ylabel("Games")
Out[114]:
In [111]:
plots=[data.Turns_Played.plot(title="Corporation and Runner Agenda Victories", legend=True, label="Turns Played", kind='hist', bins=range(1,60)),
data.Turns_Played[data.Result=="AgendaDefeat"].plot(legend=True,
label="Runner Victory",
kind='hist', bins=range(1,60)),
data.Turns_Played[data.Result=="AgendaVictory"].plot(legend=True,
label="Corporate Agenda Victory",
kind='hist', bins=range(1,60))]
plots[1].set_xlabel("Turns")
plots[1].set_ylabel("Games")
Out[111]:
In [110]:
plots=[data.Turns_Played[data.Result=="AgendaDefeat"].plot(title="Corporation and Runner Total Victories",
legend=True,
label="Runner Victory",
x="Turns",
y="Games",
kind='hist', bins=range(1,60)),
data.Turns_Played[(data.Result=="AgendaVictory") | (data.Result=="FlatlineVictory")].plot(legend=True,
label="Corporate Victory",
alpha=.5,
kind='hist', bins=range(1,60))]
plots[1].set_xlabel("Turns")
plots[1].set_ylabel("Games")
Out[110]:
In [113]:
plots=[(data.Corp_Score - data.Runner_Score)[data.Result=="AgendaVictory"].plot(title="Difference in Scores",
legend=True,
alpha=.5,
label="Corp Win",
kind='hist', bins=range(-10,10)),
(data.Corp_Score - data.Runner_Score)[(data.Result=="AgendaDefeat")].plot(title="Difference in Scores",
legend=True,
alpha=.5,
label="Runner Win",
kind='hist', bins=range(-10,10))]
plots[1].set_xlabel("Corp - Runner")
plots[1].set_ylabel("Games")
Out[113]:
In [116]:
player_wins = {}
for player in set(data.Corp_Player).union(data.Runner_Player):
player_wins[player] = 0
In [134]:
for i, entry in data.iterrows():
if entry.Win:
player_wins[entry.Corp_Player] += 1
else:
player_wins[entry.Runner_Player] += 1
In [137]:
df=pandas.DataFrame(player_wins.items(), columns=["id","wins"])
In [142]:
df.wins.plot(kind="hist",bins=range(1,30))
Out[142]:
In [ ]: